package com.nbsaas.boot.app.rest.resource;

import com.nbsaas.boot.app.api.apis.AppUserRoleApi;
import com.nbsaas.boot.app.data.entity.AppUserRole;
import com.nbsaas.boot.app.api.domain.request.AppUserRoleRequest;
import com.nbsaas.boot.app.api.domain.response.AppUserRoleResponse;
import com.nbsaas.boot.app.api.domain.simple.AppUserRoleSimple;
import com.nbsaas.boot.app.rest.convert.AppUserRoleSimpleConvert;
import com.nbsaas.boot.app.rest.convert.AppUserRoleEntityConvert;
import com.nbsaas.boot.app.rest.convert.AppUserRoleResponseConvert;
import com.nbsaas.boot.app.data.repository.AppUserRoleRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   应用用户角色-业务接口实现
*/
@Transactional
@Service
public class AppUserRoleResource extends BaseResource<AppUserRole,AppUserRoleResponse, AppUserRoleSimple, AppUserRoleRequest>  implements AppUserRoleApi {

    @Resource
    private AppUserRoleRepository appUserRoleRepository;

    @Override
    public JpaRepositoryImplementation<AppUserRole, Serializable> getJpaRepository() {
        return appUserRoleRepository;
    }

    @Override
    public Function<AppUserRole, AppUserRoleSimple> getConvertSimple() {
        return new AppUserRoleSimpleConvert();
    }

    @Override
    public Function<AppUserRoleRequest, AppUserRole> getConvertForm() {
        return new AppUserRoleEntityConvert();
    }

    @Override
    public Function<AppUserRole, AppUserRoleResponse> getConvertResponse() {
        return new AppUserRoleResponseConvert();
    }




}


